home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / obj2asm.zip / ORLNAMES.C < prev    next >
Text File  |  1991-10-01  |  1KB  |  51 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include "o.h"
  4.  
  5. int name_compare( NAME_T *, NAME_T * );
  6. void name_insert( char * );
  7.  
  8. int name_compare( rec_1, rec_2 )
  9.     NAME_T  *rec_1;
  10.     NAME_T  *rec_2;
  11. {
  12.     if ( rec_1->index > rec_2->index ) {
  13.         return( LEFT );
  14.     } else {
  15.         if ( rec_1->index < rec_2->index ) {
  16.             return( RIGHT );
  17.         } else {
  18.             return( EQUAL );
  19.         }
  20.     }
  21. }
  22.  
  23. void name_insert( this_name )
  24.     char    *this_name;
  25. {
  26.     static  name_count = 0;
  27.     NAME_T  *name_rec;
  28.  
  29.     name_count++;
  30.     name_rec = (NAME_T *)o_malloc( sizeof(NAME_T) );
  31.     name_rec->index = name_count;
  32.     strcpy( name_rec->name, this_name );
  33.  
  34.     insert( (char *)name_rec, name_tree, TC name_compare );
  35. }
  36.  
  37. void lnames( length )
  38.     word length;
  39. {
  40.     char    mod_name[41];
  41.     char    cksum;
  42.  
  43.     --length;
  44.     while( length ) {
  45.         length -= get_name( mod_name );
  46.         name_insert( mod_name );
  47.     }
  48.     cksum = get_byte();
  49.     cksum = cksum;
  50. }
  51.